#!/bin/bash 
apt-get update -y
tar -xvf node-v18.16.0-linux-x64.tar.xz
sleep 3
cd node-v18.16.0-linux-x64/
mkdir -p /usr/local/lib/node/nodejs
sleep 3
cp -R * /usr/local/lib/node/nodejs
echo -e "export NODEJS_HOME=/usr/local/lib/node/nodejs
export PATH=$NODEJS_HOME/bin:$PATH" >> /etc/profile
source /etc/profile
echo "安装成功"
sleep 3
cd ..
cd /usr/bin
 sudo ln -s /usr/local/lib/node/nodejs/bin/node node
 sudo ln -s /usr/local/lib/node/nodejs/bin/npm  npm
 echo  "node -v 查看版本"
